import 'dart:convert';

import 'package:json_annotation/json_annotation.dart';

part 'sj_login_response_data.g.dart';

@JsonSerializable()
class SjLoginResponseData {
  final int? code;
  final SjLoginData? data;
  final bool? fail;
  final String? key;
  final String? msg;
  final bool? success;

  SjLoginResponseData(
      {this.code, this.data, this.fail, this.key, this.msg, this.success});

  factory SjLoginResponseData.fromJson(Map<String, dynamic> json) =>
      _$SjLoginResponseDataFromJson(json);
  Map<String, dynamic> toJson() => _$SjLoginResponseDataToJson(this);
}

@JsonSerializable()
class SjUserInfoResponseData {
  final int? code;
  final SjUserInfoData? data;
  final bool? fail;
  final String? key;
  final String? msg;
  final bool? success;

  SjUserInfoResponseData(
      {this.code, this.data, this.fail, this.key, this.msg, this.success});

  factory SjUserInfoResponseData.fromJson(Map<String, dynamic> json) =>
      _$SjUserInfoResponseDataFromJson(json);
  Map<String, dynamic> toJson() => _$SjUserInfoResponseDataToJson(this);
}

@JsonSerializable()
class SjLoginData {
  final int? aaaa;
  final bool? isFirstRegister;
  final String? token;
  final SjUserInfoData? userInfo;

  SjLoginData({this.aaaa, this.isFirstRegister, this.token, this.userInfo});
  factory SjLoginData.fromJson(Map<String, dynamic> json) =>
      _$SjLoginDataFromJson(json);
  Map<String, dynamic> toJson() => _$SjLoginDataToJson(this);
}

@JsonSerializable()
class SjUserInfoData {
    String? userId;
    int? userType;
    String? nickname;
    bool? isInternal;
    String? avatar;
    int? avatarStatus;
    int? hasIllegalAvatar;
    String? avatarUrl;
    String? avatarThumbUrl;
    String? avatarMiddleThumbUrl;
    List<SjAvatarRespList>? avatarRespList;
    List<dynamic>? mediumList;
    int? gender;
    String? birthday;
    int? age;
    String? country;
    String? pkgName;
    List<dynamic>? mediaList;
    bool? isAnswer;
    int? availableCoins;
    int? auditStatus;
    bool? isShowReviewSupplementTips;
    List<String>? tagsList;
    List<SjTagDetail>? tagDetails;
    String? rongcloudToken;
    String? rcToken;
    bool? isRecharge;
    bool? isVip;
    int? level;
    int? followNum;
    int? praiseNum;
    bool? isBlock;
    bool? isSwitchNotDisturbIm;
    bool? isSwitchNotDisturbCall;
    bool? isHavePassword;
    bool? isReview;
    bool? isMultiple;
    String? registerPkgName;
    String? registerCountry;
    String? loginPkgName;
    int? giftWallAction;
    bool? hasEquity;
    int? createTime;
    int? followingNum;
    bool? autoTranslate;

    SjUserInfoData({
         this.userId,
         this.userType,
         this.nickname,
         this.isInternal,
         this.avatar,
         this.avatarStatus,
         this.hasIllegalAvatar,
         this.avatarUrl,
         this.avatarThumbUrl,
         this.avatarMiddleThumbUrl,
         this.avatarRespList,
         this.mediumList,
         this.gender,
         this.birthday,
         this.age,
         this.country,
         this.pkgName,
         this.mediaList,
         this.isAnswer,
         this.availableCoins,
         this.auditStatus,
         this.isShowReviewSupplementTips,
         this.tagsList,
         this.tagDetails,
         this.rongcloudToken,
         this.rcToken,
         this.isRecharge,
         this.isVip,
         this.level,
         this.followNum,
         this.praiseNum,
         this.isBlock,
         this.isSwitchNotDisturbIm,
         this.isSwitchNotDisturbCall,
         this.isHavePassword,
         this.isReview,
         this.isMultiple,
         this.registerPkgName,
         this.registerCountry,
         this.loginPkgName,
         this.giftWallAction,
         this.hasEquity,
         this.createTime,
         this.followingNum,
         this.autoTranslate
    });

      factory SjUserInfoData.fromJson(Map<String, dynamic> json) =>
      _$SjUserInfoDataFromJson(json);
  Map<String, dynamic> toJson() => _$SjUserInfoDataToJson(this);
}

@JsonSerializable()
class SjAvatarRespList {
    String? mediaPath;
    String? mediaUrl;
    String? middleThumbUrl;
    String? thumbUrl;
    int? status;

    SjAvatarRespList({
         this.mediaPath,
         this.mediaUrl,
         this.middleThumbUrl,
         this.thumbUrl,
         this.status,
    });
  factory SjAvatarRespList.fromJson(Map<String, dynamic> json) =>
      _$SjAvatarRespListFromJson(json);
  Map<String, dynamic> toJson() => _$SjAvatarRespListToJson(this);
}

@JsonSerializable()
class SjTagDetail {
    String? tag;
    String? tagTip;
    String? tagColor;

    SjTagDetail({
         this.tag,
         this.tagTip,
         this.tagColor,
    });
  factory SjTagDetail.fromJson(Map<String, dynamic> json) =>
      _$SjTagDetailFromJson(json);
  Map<String, dynamic> toJson() => _$SjTagDetailToJson(this);
}

class SjUserDetailData {
    String? userId;
    int? userType;
    String? nickname;
    bool? isInternal;
    String? avatar;
    int? avatarStatus;
    int? hasIllegalAvatar;
    String? avatarUrl;
    String? avatarThumbUrl;
    String? avatarMiddleThumbUrl;
    List<SjAvatarRespList>? avatarRespList;
    List<dynamic>? mediumList;
    int? gender;
    String? birthday;
    int? age;
    String? country;
    String? pkgName;
    List<dynamic>? mediaList;
    bool? isAnswer;
    int? availableCoins;
    int? auditStatus;
    bool? isShowReviewSupplementTips;
    List<String>? tagsList;
    List<SjTagDetail>? tagDetails;
    String? rongcloudToken;
    String? rcToken;
    bool? isRecharge;
    bool? isVip;
    int? level;
    int? followNum;
    int? praiseNum;
    bool? isBlock;
    bool? isSwitchNotDisturbIm;
    bool? isSwitchNotDisturbCall;
    bool? isHavePassword;
    bool? isReview;
    bool? isMultiple;
    String? registerPkgName;
    String? registerCountry;
    bool? isFakeBroadcaster;
    String? loginPkgName;
    int? giftWallAction;
    bool? hasEquity;
    String? createTime;
    int? followingNum;
    bool? autoTranslate;

    SjUserDetailData({
        this.userId,
        this.userType,
        this.nickname,
        this.isInternal,
        this.avatar,
        this.avatarStatus,
        this.hasIllegalAvatar,
        this.avatarUrl,
        this.avatarThumbUrl,
        this.avatarMiddleThumbUrl,
        this.avatarRespList,
        this.mediumList,
        this.gender,
        this.birthday,
        this.age,
        this.country,
        this.pkgName,
        this.mediaList,
        this.isAnswer,
        this.availableCoins,
        this.auditStatus,
        this.isShowReviewSupplementTips,
        this.tagsList,
        this.tagDetails,
        this.rongcloudToken,
        this.rcToken,
        this.isRecharge,
        this.isVip,
        this.level,
        this.followNum,
        this.praiseNum,
        this.isBlock,
        this.isSwitchNotDisturbIm,
        this.isSwitchNotDisturbCall,
        this.isHavePassword,
        this.isReview,
        this.isMultiple,
        this.registerPkgName,
        this.registerCountry,
        this.isFakeBroadcaster,
        this.loginPkgName,
        this.giftWallAction,
        this.hasEquity,
        this.createTime,
        this.followingNum,
        this.autoTranslate,
    });

    SjUserDetailData copyWith({
        String? userId,
        int? userType,
        String? nickname,
        bool? isInternal,
        String? avatar,
        int? avatarStatus,
        int? hasIllegalAvatar,
        String? avatarUrl,
        String? avatarThumbUrl,
        String? avatarMiddleThumbUrl,
        List<SjAvatarRespList>? avatarRespList,
        List<dynamic>? mediumList,
        int? gender,
        String? birthday,
        int? age,
        String? country,
        String? pkgName,
        List<dynamic>? mediaList,
        bool? isAnswer,
        int? availableCoins,
        int? auditStatus,
        bool? isShowReviewSupplementTips,
        List<String>? tagsList,
        List<SjTagDetail>? tagDetails,
        String? rongcloudToken,
        String? rcToken,
        bool? isRecharge,
        bool? isVip,
        int? level,
        int? followNum,
        int? praiseNum,
        bool? isBlock,
        bool? isSwitchNotDisturbIm,
        bool? isSwitchNotDisturbCall,
        bool? isHavePassword,
        bool? isReview,
        bool? isMultiple,
        String? registerPkgName,
        String? registerCountry,
        bool? isFakeBroadcaster,
        String? loginPkgName,
        int? giftWallAction,
        bool? hasEquity,
        String? createTime,
        int? followingNum,
        bool? autoTranslate,
    }) => 
        SjUserDetailData(
            userId: userId ?? this.userId,
            userType: userType ?? this.userType,
            nickname: nickname ?? this.nickname,
            isInternal: isInternal ?? this.isInternal,
            avatar: avatar ?? this.avatar,
            avatarStatus: avatarStatus ?? this.avatarStatus,
            hasIllegalAvatar: hasIllegalAvatar ?? this.hasIllegalAvatar,
            avatarUrl: avatarUrl ?? this.avatarUrl,
            avatarThumbUrl: avatarThumbUrl ?? this.avatarThumbUrl,
            avatarMiddleThumbUrl: avatarMiddleThumbUrl ?? this.avatarMiddleThumbUrl,
            avatarRespList: avatarRespList ?? this.avatarRespList,
            mediumList: mediumList ?? this.mediumList,
            gender: gender ?? this.gender,
            birthday: birthday ?? this.birthday,
            age: age ?? this.age,
            country: country ?? this.country,
            pkgName: pkgName ?? this.pkgName,
            mediaList: mediaList ?? this.mediaList,
            isAnswer: isAnswer ?? this.isAnswer,
            availableCoins: availableCoins ?? this.availableCoins,
            auditStatus: auditStatus ?? this.auditStatus,
            isShowReviewSupplementTips: isShowReviewSupplementTips ?? this.isShowReviewSupplementTips,
            tagsList: tagsList ?? this.tagsList,
            tagDetails: tagDetails ?? this.tagDetails,
            rongcloudToken: rongcloudToken ?? this.rongcloudToken,
            rcToken: rcToken ?? this.rcToken,
            isRecharge: isRecharge ?? this.isRecharge,
            isVip: isVip ?? this.isVip,
            level: level ?? this.level,
            followNum: followNum ?? this.followNum,
            praiseNum: praiseNum ?? this.praiseNum,
            isBlock: isBlock ?? this.isBlock,
            isSwitchNotDisturbIm: isSwitchNotDisturbIm ?? this.isSwitchNotDisturbIm,
            isSwitchNotDisturbCall: isSwitchNotDisturbCall ?? this.isSwitchNotDisturbCall,
            isHavePassword: isHavePassword ?? this.isHavePassword,
            isReview: isReview ?? this.isReview,
            isMultiple: isMultiple ?? this.isMultiple,
            registerPkgName: registerPkgName ?? this.registerPkgName,
            registerCountry: registerCountry ?? this.registerCountry,
            isFakeBroadcaster: isFakeBroadcaster ?? this.isFakeBroadcaster,
            loginPkgName: loginPkgName ?? this.loginPkgName,
            giftWallAction: giftWallAction ?? this.giftWallAction,
            hasEquity: hasEquity ?? this.hasEquity,
            createTime: createTime ?? this.createTime,
            followingNum: followingNum ?? this.followingNum,
            autoTranslate: autoTranslate ?? this.autoTranslate,
        );

    factory SjUserDetailData.fromRawJson(String str) => SjUserDetailData.fromJson(json.decode(str));

    String toRawJson() => json.encode(toJson());

    factory SjUserDetailData.fromJson(Map<String, dynamic> json) => SjUserDetailData(
        userId: json["userId"],
        userType: json["userType"],
        nickname: json["nickname"],
        isInternal: json["isInternal"],
        avatar: json["avatar"],
        avatarStatus: json["avatarStatus"],
        hasIllegalAvatar: json["hasIllegalAvatar"],
        avatarUrl: json["avatarUrl"],
        avatarThumbUrl: json["avatarThumbUrl"],
        avatarMiddleThumbUrl: json["avatarMiddleThumbUrl"],
        avatarRespList: json["avatarRespList"] == null ? [] : List<SjAvatarRespList>.from(json["avatarRespList"]!.map((x) => SjAvatarRespList.fromJson(x))),
        mediumList: json["mediumList"] == null ? [] : List<dynamic>.from(json["mediumList"]!.map((x) => x)),
        gender: json["gender"],
        birthday: json["birthday"],
        age: json["age"],
        country: json["country"],
        pkgName: json["pkgName"],
        mediaList: json["mediaList"] == null ? [] : List<dynamic>.from(json["mediaList"]!.map((x) => x)),
        isAnswer: json["isAnswer"],
        availableCoins: json["availableCoins"],
        auditStatus: json["auditStatus"],
        isShowReviewSupplementTips: json["isShowReviewSupplementTips"],
        tagsList: json["tagsList"] == null ? [] : List<String>.from(json["tagsList"]!.map((x) => x)),
        tagDetails: json["tagDetails"] == null ? [] : List<SjTagDetail>.from(json["tagDetails"]!.map((x) => SjTagDetail.fromJson(x))),
        rongcloudToken: json["rongcloudToken"],
        rcToken: json["rcToken"],
        isRecharge: json["isRecharge"],
        isVip: json["isVip"],
        level: json["level"],
        followNum: json["followNum"],
        praiseNum: json["praiseNum"],
        isBlock: json["isBlock"],
        isSwitchNotDisturbIm: json["isSwitchNotDisturbIm"],
        isSwitchNotDisturbCall: json["isSwitchNotDisturbCall"],
        isHavePassword: json["isHavePassword"],
        isReview: json["isReview"],
        isMultiple: json["isMultiple"],
        registerPkgName: json["registerPkgName"],
        registerCountry: json["registerCountry"],
        isFakeBroadcaster: json["isFakeBroadcaster"],
        loginPkgName: json["loginPkgName"],
        giftWallAction: json["giftWallAction"],
        hasEquity: json["hasEquity"],
        createTime: json["createTime"],
        followingNum: json["followingNum"],
        autoTranslate: json["autoTranslate"],
    );

    Map<String, dynamic> toJson() => {
        "userId": userId,
        "userType": userType,
        "nickname": nickname,
        "isInternal": isInternal,
        "avatar": avatar,
        "avatarStatus": avatarStatus,
        "hasIllegalAvatar": hasIllegalAvatar,
        "avatarUrl": avatarUrl,
        "avatarThumbUrl": avatarThumbUrl,
        "avatarMiddleThumbUrl": avatarMiddleThumbUrl,
        "avatarRespList": avatarRespList == null ? [] : List<dynamic>.from(avatarRespList!.map((x) => x.toJson())),
        "mediumList": mediumList == null ? [] : List<dynamic>.from(mediumList!.map((x) => x)),
        "gender": gender,
        "birthday": birthday,
        "age": age,
        "country": country,
        "pkgName": pkgName,
        "mediaList": mediaList == null ? [] : List<dynamic>.from(mediaList!.map((x) => x)),
        "isAnswer": isAnswer,
        "availableCoins": availableCoins,
        "auditStatus": auditStatus,
        "isShowReviewSupplementTips": isShowReviewSupplementTips,
        "tagsList": tagsList == null ? [] : List<dynamic>.from(tagsList!.map((x) => x)),
        "tagDetails": tagDetails == null ? [] : List<dynamic>.from(tagDetails!.map((x) => x.toJson())),
        "rongcloudToken": rongcloudToken,
        "rcToken": rcToken,
        "isRecharge": isRecharge,
        "isVip": isVip,
        "level": level,
        "followNum": followNum,
        "praiseNum": praiseNum,
        "isBlock": isBlock,
        "isSwitchNotDisturbIm": isSwitchNotDisturbIm,
        "isSwitchNotDisturbCall": isSwitchNotDisturbCall,
        "isHavePassword": isHavePassword,
        "isReview": isReview,
        "isMultiple": isMultiple,
        "registerPkgName": registerPkgName,
        "registerCountry": registerCountry,
        "isFakeBroadcaster": isFakeBroadcaster,
        "loginPkgName": loginPkgName,
        "giftWallAction": giftWallAction,
        "hasEquity": hasEquity,
        "createTime": createTime,
        "followingNum": followingNum,
        "autoTranslate": autoTranslate,
    };
}
